<?php
/**
 * Created by IntelliJ IDEA.
 * User: XD
 * Date: 2017/8/22
 * Time: 18:23
 */
if(!file_exists("welcome.txt")){
    die("文件不存在");
}else{
    $file = fopen("welcome.txt","r" );
}

function customError($errno,$errstr){
    echo "<b>Error:</b> [$errno] $errstr<br>";
    echo "脚本结束";
    error_log("Error:[$errno] $errstr",1,"xujiang5@163.com","From:xujiang5@163.com");
    die();
}

set_error_handler("customError",E_USER_WARNING);

echo ($tset);

$test = 2;
if($test>1){
    trigger_error("变量值必须小于等于 1",E_USER_WARNING);
}

?>